package com.chen.thread.controller;

import com.chen.thread.dto.User2;
import com.chen.thread.service.User2Service;

import io.swagger.models.Response;
import lombok.extern.slf4j.Slf4j;
import org.json.JSONObject;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


import javax.annotation.Resource;
import java.util.List;

@RestController
@Slf4j
public class User2Controller {
    @Resource
    private User2Service user2Service;

//    @PostMapping("/create")
//    public void create(@RequestBody User2 user){
//        try{
//            user2Service.createDate(user);
//
//        }catch (Exception e){
////            log.error("error");//
//
//        }
//
//    }

    @PostMapping("/selectInfo")
    public List<User2> selectInfo(User2 user){
        return user2Service.selectInfo(); //这里数据量太大访问不出来 ，所以在sql中进行限制一下，如需：解除


    }
}
